using System.Data.Entity.ModelConfiguration;

public sealed class TaskMap : EntityTypeConfiguration<Task>
{
	public TaskMap()
	{
		HasKey(x => x.Id);
		HasRequired(x => x.Project).WithMany(p => p.Tasks).HasForeignKey(x => x.ProjectId);
		HasOptional(x => x.Parent).WithMany(p => p.Children).HasForeignKey(x => x.ParentId);
	}
}
